from django.template import Library

from app01 import models

register = Library()


@register.inclusion_tag("modeltag.html")
def modals(pid):
    pid_obj = models.CustomerInfo.objects.filter(pid=pid).first()
    text_dict = models.TestList.objects.filter(pid=pid_obj).all().order_by('-test_date')

    result = {"text_dict": text_dict}

    return result


@register.inclusion_tag("path_nav.html")
def path_nav(request):
    result = {"result": request.pathtools.path_infos}

    return result
